import { stringify } from 'qs';
import request from '../utils/request';

export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}

export async function removeRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'delete',
    },
  });
}

export async function addRule(params) {
  return request('/api/rule', {
    method: 'POST',
    body: {
      ...params,
      method: 'post',
    },
  });
}

export async function queryNotices() {
  return request('/api/notices');
}

// 登录
export async function fakeAccountLogin(params) {
  return request('/student/login', {
    method: 'POST',
    body: params,
  });
}

// 查看抢书包柜开始的时间
export async function checkTimeBegin() {
  return request('/graping/box', {
    method: 'GET',
  });
}

// 获取书包柜
export async function getBox() {
  return request('/graping/info', {
    method: 'GET',
  });
}

// 查看自己的书包柜
export async function inquireBox() {
  return request('/student/box', {
    method: 'GET',
  });
}

